package demo.file;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import file.manager.SdCardManager;

public class FileActivity extends Activity {
	
	private static final String TAG = "FileActivity";
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
//        FileManager.writeToSD( "test", "1.txt", "hello, how are you." );
        if( SdCardManager.writeToSD( this, "test", "1.txt", "hello, how are you.", true ) )
        {
        	StringBuilder content = new StringBuilder();
        	if( SdCardManager.readFromFile(this, "test", "1.txt", content) )
        	{
        		Log.i( TAG, content.toString() );
        	}
        	else
        	{
        		Log.e( TAG, "can't read file: 1.txt" );
        	}
        	
        }

    }
}